package com.chris.getfile.config;



import com.chris.getfile.comm.JacksonUtil;
import com.chris.getfile.comm.ObjectMapperUtil;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
//@ComponentScan("com.chris.config")
public class JacksonConfig {

    @Bean(name = "app_objectMapper")
    @Primary
    //@ConditionalOnMissingBean(ObjectMapper.class)
    public ObjectMapper objectMapper()
    {
        return  new ObjectMapperUtil().objectMapper();
    }

    @Bean(name = "app_jacksonUtil")
    @Primary
    public JacksonUtil jacksonUtil() {
        return new JacksonUtil(objectMapper());
    }



}
